﻿CREATE PROCEDURE [dbo].[proc_Wage_UpdateFinance_DF]
	(
		@Id INT,
		@userid VARCHAR(20),
		@username  nVARCHAR(20)
	)
AS
	Update Employee_Wage Set FinanceFlag_DF=2,FinanceFlagDate_DF=GetDate(),FinanceFlagUser_DF=@userid Where Id=@Id
	
	
	--Insert Into Finance_Outlay
	--(
	--	CreateDate,
	--	TradeDate,
	--	Summary,
	--	CateOneId,
	--	CateOneName,
	--	CateTwoId,
	--	CateTwoName,
	--	SubjectId,
	--	SubjectName,
	--	PaymentTypeId,
	--	PaymentTypeName,
	--	BankId,
	--	BankName,
	--	OutlayReason,
	--	OutlayPrice,
	--	Agent,
	--	AgentName,
	--	PZPerson,
	--	PZPersonName,
	--	SHPerson,
	--	SHPersonName,
	--	UserName,
	--	EName,
	--	Description,
	--	BillNumber,
	--	CompanyId,
	--	CompanyIdCur,
	--	DepartmentIdCur
	--)
	--SELECT 
	--	GETDATE(),
	--	Convert(varchar(10),GETDATE(),120),
	--	[EName]+'补助',
	--	16,
	--	'费用类',
	--	10,
	--	'人力费用',
	--	187,
	--	'人员工资',
	--	1,
	--	'现金',
	--	1,
	--	'现金',
	--	[EName]+'工资',
	--	ew.DFHeJi,
	--	@userid,
	--	@username,
	--	'',
	--	'',
	--	'',
	--	'',
	--	@userid,
	--	@username,
	--	'',
	--	'',
	--	ew.CompanyId,
	--	ew.CompanyId,
	--	0
	--FROM Employee_Wage ew WHERE id=@Id
	
RETURN
